//
//  VCForCell.m
//  PCAForWar
//
//  Created by dllo on 16/2/24.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "VCForCell.h"
#import <DKNightVersion.h>
#import "ModelForYaoWen.h"
#import "DataBaseHandler.h"
#import "ModelForChinaJunQIng.h"

@interface VCForCell () <UIWebViewDelegate>

@property (nonatomic, retain) UIWebView *webForVC;
@property (nonatomic, retain) ModelForYaoWen *modelYw;

@property (nonatomic, retain) UIActivityIndicatorView *IndicatorView;

@end

@implementation VCForCell

- (void)dealloc{
    
    _webForVC.delegate = nil;
    [_webForVC release];
    [_IndicatorView release];
    [super dealloc];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    
    CGRect frame = self.view.frame;
    
    self.webForVC = [[UIWebView alloc ]initWithFrame:CGRectMake(0, -140, CGRectGetWidth(frame), CGRectGetHeight(frame) + 140)];
    
    self.webForVC.userInteractionEnabled = YES;
    self.webForVC.delegate = self;
    self.webForVC.opaque = NO;
    
    [self.view addSubview:self.webForVC];
    
    NSURL *url = [NSURL URLWithString:self.Location];
    
    [self.webForVC loadRequest:[NSURLRequest requestWithURL:url]];
    
    [_webForVC release];
    
    [self addIndicatorView];
}

- (void) addIndicatorView {
    
    self.IndicatorView= [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    
    [self.IndicatorView setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhiteLarge];
    
    self.IndicatorView.center = self.view.center;
    
    self.IndicatorView.color = [UIColor blackColor];
    
    [self.view addSubview:self.IndicatorView];
    
    [_IndicatorView release];
    
    [self.IndicatorView startAnimating];
}

#pragma mark 网络视图加载完成的时候调用此方法
- (void)webViewDidFinishLoad:(UIWebView *)webView {
    
    [self.IndicatorView stopAnimating];
}







- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
